package com.ayit.car.service.impl;

import com.ayit.car.common.result.PageResult;
import com.ayit.car.pojo.dto.ColorsPageQueryDTO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ayit.car.pojo.Colors;
import com.ayit.car.service.ColorsService;
import com.ayit.car.mapper.ColorsMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 为王下葬
* @description 针对表【colors(颜色表)】的数据库操作Service实现
* @createDate 2024-06-24 18:12:48
*/
@Service
public class ColorsServiceImpl extends ServiceImpl<ColorsMapper, Colors>
    implements ColorsService{

    @Autowired
    private ColorsMapper colorsMapper;

    @Override
    public PageResult pageQuery(ColorsPageQueryDTO colorsPageQueryDTO) {
        PageHelper.startPage(colorsPageQueryDTO.getPage(),colorsPageQueryDTO.getPageSize());

        Page<Colors> page = colorsMapper.pageQuery(colorsPageQueryDTO);
        return new PageResult(page.getTotal(),page.getResult());
    }
}




